package com.qlmjx.sevalopos.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.qlmjx.sevalopos.Bean.CustomerGoodsBean;
import com.qlmjx.sevalopos.Bean.ModleBean;
import com.qlmjx.sevalopos.R;
import com.qlmjx.sevalopos.utils.ViewHolder;
import com.universal.frame.generalutils.DecimalUtil;

import java.util.List;

/**
 * Created by sa on 2018/7/20.
 */



public class PopAdapter extends BaseAdapter {

    private Context context;
    private List<ModleBean> list;


    public PopAdapter(Context context, List<ModleBean> list){
        this.context = context;
        this.list = list;

    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public ModleBean getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {
        ModleBean bean = getItem(position);
        if(view == null){
            view = View.inflate(context, R.layout.item_model,null);
        }

        TextView tv_jh = ViewHolder.get(view, R.id.tv_jh);
        tv_jh.setText(bean.SERIAL_NO);
        TextView tv_jx = ViewHolder.get(view, R.id.tv_jx);
        tv_jx.setText(bean.MODEL_NAME);
        return view;
    }
}
